#include <iostream>
#include <string>

using namespace std;

void myswap(char &a, char &b)
{
	char temp = a;
	a = b;
	b = temp;
}

int main()
{
	string s;
	cin >> s;

	int a, b, c, cnt = 0;
	a = b = 0;
	c = s.size() - 1;
	while (b <= c) {
		if (s[b] == 'R') {
			if (s[a] != 'R') {
				cnt++;
				myswap(s[a], s[b]);
			}
			a++;
			b++;
		}
		else if (s[b] == 'B') {
			if (s[c] != 'B') {
				cnt++;
				myswap(s[b], s[c]);
			}
			c--;
		}
		else {
			b++;
		}
	}
	cout << cnt << " : "<< s << endl;
	
	return 0;
}